package SpringCloudBase.fegin;

import SpringCloudBase.vo.UserVO;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @ClassName FeignClient01Factory
 * @Description : 功能说明
 * @Author : LiangT
 * @Date : 2020/4/1 15:56
 */
@Component
public class FeignClient01Factory implements FallbackFactory<FeginClient01> {
    @Override
    public FeginClient01 create(Throwable throwable) {
        return new FeginClient01() {
            @Override
            public UserVO getOrder(Long id) {
                UserVO userVO = new UserVO();
                userVO.setDate(new Date());
                userVO.setId(-1100L);
                return userVO;
            }

            @Override
            public UserVO get_user(UserVO userVO) {
                return userVO;
            }
        };
    }
}
